package cn.kgc.entity;

import java.util.Date;
import java.io.Serializable;

import cn.kgc.common.serialize.DictSerialize;
import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.*;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * (Dict)表实体类
 *
 * @author 石浩杰
 * @since 2022-09-24 08:30:39
 */
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@Builder
@TableName(value = "dict")
@SuppressWarnings("serial")
@JsonSerialize(using = DictSerialize.class)
public class Dict extends Model<Dict> implements Serializable {

    @TableId(type = IdType.AUTO)
    private Long id; //主键


    @TableField(value = "name")
    private String name;


    /**
     * 数据字典值
     **/
    @TableField(value = "value")
    private String value;


    /**
     * 数据字典编码
     **/
    @TableField(value = "code")
    private String code;


    /**
     * 数据字典类型
     **/
    @TableField(value = "type")
    private Integer type;


    /**
     * 数据字典pid
     **/
    @TableField(value = "pid")
    private Integer pid;


    @Version
    private int version;   //版本


    @TableLogic
    @JsonIgnore
    @TableField(fill = FieldFill.INSERT)
    private int deleted;  //逻辑删除标志


    /**
     * 新增用户id
     **/
    @TableField(value = "insertuid")
    private Integer insertuid;


    /**
     * 更新用户id
     **/
    @TableField(value = "updateuid")
    private Integer updateuid;


    @TableField(value = "creationdate", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date creationDate; //创建时间


    @TableField(value = "modifydate", fill = FieldFill.UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date modifyDate; //修改时间


}
